//function GetQueryString(name) {
//    var reg = new RegExp("(^|&)" + name + "=([^&]*)(&|$)");
//    var r = window.location.search.substr(1).match(reg);
//    if (r != null)
//        return decodeURI(r[2]);
//    return null;
//}

index = parent.layer.getFrameIndex(window.name);
//url = GetQueryString('url');

$('#closeIframe').click(function(){
    parent.layer.close(index);
});

$.ajax({
    type:"POST",
    url:constUrl+"socketlog/detail",
    dataType:"json",
    data: {
        logFile: url
    },
    success:function(data){
    	console.log(data.preview)
        $("#detail-content").append(data.preview
        		.replace(/</g,"&lt;")
        		.replace(/>/g,"&gt;")
        		.replace(/\r\n/g,"<br/>")
        		.replace(/\n/g,"<br/>")
        		.replace(/\n/g,"<br/>"))
        $("#downloadIframe").attr("href", constUrl+"SocketLogFileDownload?uri="+data.url)
    },
    error:function () {
    }
});